<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <!--v-on：事件名=”方法“ 给元素绑定事件-->
    <input type="button" value="按钮1" v-on:click="f()">
    <!--事件绑定简写-->
    <input type="button" value="按钮2" @click="f()">
</div>
<!--引入vue-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.14/vue.js"></script>
<script>
    let v = new Vue({
        el:"#app",
        data:{},
        methods:{
            f(){
                alert("点我干嘛!");
            }
        }

    })
</script>

</body>
</html>